import type { CardListData, CardListParams, CardParams, EditCardParams, getParkingCardDetailData } from "@/types/card";
import { request } from "@/utils/reuqest";

// 获取月卡列表
export const getCardListAPI = (params:CardListParams) =>{
    return request<CardListData>('/parking/card/list','GET',params)
}

// 新增月卡列表

export const createCard = (params:CardParams) =>{
    return request('/parking/card','POST',params)
}

// 编辑月卡详情(数据回显)

export const getParkingCardDetail = (id:string) =>{
    return request<getParkingCardDetailData>(`/parking/card/detail/${id}`,'GET')
}

// 编辑月卡
export const getParkingCardEdit = (id:string,params:EditCardParams) =>{
    return request(`/parking/card/edit`,'PUT',params)
}
// 删除月卡
export const DeleteCard = (ids:number[]) =>{
    return request(`/parking/card/${ids.join(',')}`,'DELETE')
}
